package com.aispeech.asr.clib.post;

import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

public class PostResult {
    @Getter
    @Setter
    int status;
    @Getter
    private AlignInfo segment;
    @Getter
    private AlignInfo merged;
    @Getter
    private Map<String, Long> metrics;

    public PostResult() {
        segment = new AlignInfo();
        merged = new AlignInfo();
        metrics = new HashMap<>();
    }

    public void addSegmentElement(long start, long end, String speaker, String rec, String pinyin, char pos) {
        segment.addElement(start, end, speaker, rec, pinyin, pos);
    }

    public void addMergedElement(long start, long end, String speaker, String rec, String pinyin, char pos) {
        merged.addElement(start, end, speaker, rec, pinyin, pos);
    }

    public void addMetrics(String key, long value) {
        metrics.put(key, value);
    }
}
